From 863157b392b61bb28c557b88f741834355b16714 Mon Sep 17 00:00:00 2001 From: Robert Lipe Date: Tue, 27 Oct 2020 03:28:03 -0500 Subject: [PATCH] ozi: don't deinit a write stream if we don't have one. We can get into close() with a null stream_ TextStream. I think it has to do with ozi_openfile() reopening a file with a new name to match an extension of a certain type so it's renaming a file that hasn't been written. See issue #646 --- ozi.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ozi.cc b/ozi.cc index 87f7e036d..e496277bc 100644 --- a/ozi.cc +++ b/ozi.cc @@ -172,6 +172,9 @@ ozi_open_io(const QString& fname, QIODevice::OpenModeFlag mode) static void ozi_close_io() { + if (!stream) { + return; + } stream->close(); delete stream; stream = nullptr; -- 2.30.2